package com.nicolaspigelet.dopplrclient.UI 
{
	import flash.display.Sprite;
	import flash.filters.DropShadowFilter;
	import flash.text.Font;
	import flash.text.TextField;
	import flash.text.TextFieldAutoSize;
	import flash.text.TextFormat;
	import flash.text.TextFormatAlign;
	
	/**
	 * @author Nicolas Pigelet aka tanaki
	 */
	public class InfoUI extends Sprite
	{
		private var __coolvetica:Font;
		private var __container:Sprite;
		private var __text:TextField;
		
		public function InfoUI() 
		{
			__coolvetica = new Coolvetica();
			
			__container = new Sprite();
			__container.graphics.beginFill(0xffffff);
			__container.graphics.drawRect(0, 0, 150, 40);
			__container.filters = [new DropShadowFilter(2, 45, 0, .4, 6, 6, 1, 3)];
			
			__text = new TextField();
			__text.embedFonts = true;
			__text.autoSize = TextFieldAutoSize.CENTER;
			__text.defaultTextFormat = new TextFormat(__coolvetica.fontName, 18, 0x000000, false, false, false, null, null, TextFormatAlign.CENTER);
			__text.text = "Info";
			__text.y = 5;
			__text.x = (__container.width - __text.width) >> 1;
			__text.mouseEnabled = false;
			__container.addChild(__text);
			
			addChild(__container);
		}
		
		public function setText(value:String):void {
			__text.text = value;
		}
		
	}

}